import request from '@/utils/request'

// 查询部门列表
export function getDepartment() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
// 查询单个部门
export function getDepartmentInfoApi(id) {
  return request({
    url: '/company/department/' + id,
    method: 'get'
  })
}

/**
 *
 *  获取部门负责人的数据
 * **/

export function getManagerList() {
  return request({
    url: '/sys/user/simple'
  })
}

/**
 * 新增组织
 * ***/
export function addDepartment(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 修改部门
export function editDepartmentApi(data) {
  return request({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}

// 删除部门
export function delDepartmentApi(id) {
  return request({
    method: 'delete',
    url: '/company/department/' + id

  })
}
